package cn.hwadee.muying.entity;

import cn.hwadee.muying.commons.base.BaseModel;
import com.baomidou.mybatisplus.annotations.TableField;

import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author Tony
 * @since 2018-04-17
 */
public class Permission extends BaseModel {

    private static final long serialVersionUID = 1L;
    /**
     * 上一级资源/权限
     */
    private Long pid;
    /**
     * 资源url
     */
    private String url;
    /**
     * 权限/资源名称
     */
    private String name;
    /**
     * 权限编码
     */
    private String perm;
    /**
     * 备注
     */
    private String remark;
    /**
     * 是否显示
     */
    private Boolean display;
    /**
     * 子资源列表
     */
    @TableField(exist = false)
    private List<Permission> subPerms;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPerm() {
        return perm;
    }

    public void setPerm(String perm) {
        this.perm = perm;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Boolean getDisplay() {
        return display;
    }

    public void setDisplay(Boolean display) {
        this.display = display;
    }

    public List<Permission> getSubPerms() {
        return subPerms;
    }

    public void setSubPerms(List<Permission> subPerms) {
        this.subPerms = subPerms;
    }

    @Override
    public String toString() {
        return "Permission{" +
        ", id=" + id +
        ", pid=" + pid +
        ", url=" + url +
        ", name=" + name +
        ", perm=" + perm +
        ", remark=" + remark +
        ", display=" + display +
        ", valid=" + valid +
        ", createDate=" + createDate+
        ", updateDate=" + updateDate +
        ", deleteDate=" + deleteDate +
        "}";
    }
    public static final String URL = "url";

    public static final String NAME = "name";

    public static final String PERM = "perm";

    public static final String PID = "pid";

    public static final String REMARK = "remark";

    public static final String SHOW = "show";

    public static final String ICON = "icon";
}
